package cn.glenn._07springaop.aop;

import org.springframework.stereotype.Component;

@Component
public class CalculatorImpl implements Calculator{
    @Override
    public int add(int a, int b) {
//        if (a>0){
//            throw new RuntimeException("测试");
//        }
        System.out.println("方法结果为："+(a+b));
        return a+b;
    }

    @Override
    public int sub(int a, int b) {
        System.out.println("方法结果为："+(a-b));
        return a-b;
    }

    @Override
    public int mul(int a, int b) {
        System.out.println("方法结果为："+(a/b));
        return a/b;
    }

    @Override
    public int div(int a, int b) {
        System.out.println("方法结果为："+(a*b));
        return a*b;
    }
}
